package com.admin.dao.adminlogindao;

import com.pojo.AdminBean;
import com.pojo.BorInfoBean;
import com.pojo.BorrowerBean;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface AdminDaoInf {
    public boolean adminAdd(AdminBean ab)throws SQLException;

    public int adminUpdate(AdminBean ab)throws SQLException;

    /**
     * 注册验证
     * @param sql
     * @param conn
     * @param ab
     * @return
     * @throws SQLException
     */
    public Boolean adminRegisterCheck(String sql,Connection conn,AdminBean ab) throws SQLException;


    /**
     * 管理员登录验证
     * @param ab
     * @return
     */
    public Boolean adminLoginCheck(String sql, Connection conn, AdminBean ab)throws SQLException;

    /**
     * 注册管理员
     * @param sql
     * @param conn
     * @param ab
     * @return
     */
    boolean adminRegister(String sql, Connection conn, AdminBean ab)throws SQLException;

/**
 *管理员信息
 */
   AdminBean getAdminAllInfoDao(String sql, Connection conn, String name)throws SQLException;

    /**
     * 通过书名
     * @param sql
     * @param conn
     * @param bookId
     */
    boolean returnBookById(String sql, Connection conn, String bookId,String idCard)throws SQLException ;

    /**
     * 增加借阅信息
     * @param sql
     * @param conn
     * @param borInfoBean
     * @return
     */

    boolean addLendInfo(String sql, Connection conn, BorInfoBean borInfoBean)throws SQLException;
    /**
     * 查询通过身份证号查询用户id
     * @param sql
     * @param conn
     * @param idCard
     * @return
     * @throws SQLException
     */
    BorrowerBean queryUserIdByIdCard(String sql, Connection conn, String idCard) throws SQLException ;

    boolean reduceUserStockAndBalance(String sql, Connection conn, long userId, double borrowPrice)throws SQLException ;

}
